package lleida.festamajor;

import lleida.festamajor.activities.AEventDetail;
import lleida.festamajor.activities.AEvents;
import lleida.festamajor.activities.APlace;
import lleida.festamajor.controllers.EventController;
import android.app.Application;
import android.content.Intent;

public class FestaMajorApp extends Application {

	public void onCreate() {
		EventController.readCategories(getResources().openRawResource(R.raw.categories));
		EventController.readDates(getResources().openRawResource(R.raw.dates));
		EventController.readPlaces(getResources().openRawResource(R.raw.places));
		EventController.readEvents(getResources().openRawResource(R.raw.events));
	}
	
	public void showEvents() {
		Intent intent = new Intent();
    	intent.setClass(this, AEvents.class);
    	intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    	startActivity(intent);
	}
	
	public void showEventDetail() {
		Intent intent = new Intent();
    	intent.setClass(this, AEventDetail.class);
    	intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    	startActivity(intent);
	}
	
	public void showPlace() {
		Intent intent = new Intent();
    	intent.setClass(this, APlace.class);
    	intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    	startActivity(intent);
	}
}
